package com.ruoyi.common.core.domain.event;

import org.springframework.context.ApplicationEvent;

/**
 * 用户注册成功事件
 * 
 * @author ruoyi
 */
public class UserRegisteredEvent extends ApplicationEvent
{
    private static final long serialVersionUID = 1L;

    /** 用户ID */
    private final Long userId;

    /** 用户名 */
    private final String username;

    /**
     * 创建用户注册事件
     * 
     * @param source 事件源
     * @param userId 用户ID
     * @param username 用户名
     */
    public UserRegisteredEvent(Object source, Long userId, String username)
    {
        super(source);
        this.userId = userId;
        this.username = username;
    }

    public Long getUserId()
    {
        return userId;
    }

    public String getUsername()
    {
        return username;
    }

    @Override
    public String toString()
    {
        return "UserRegisteredEvent{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                '}';
    }
}

